package com.vichat.room.service;

import com.vichat.common.vo.PageFilter;
import com.vichat.common.vo.SysMsg;
import com.vichat.room.entity.RoomBasic;
import com.vichat.room.entity.RoomMember;
import com.vichat.room.entity.TypedefWindowId;
import com.vichat.room.vo.RoomVO;

import java.util.List;

/**
 * Created by ranjx on 2017/11/20.
 */
public interface IRoomService {

    /**
     * 查询频道
     *
     * @param queryBean
     * @param pf
     * @return
     */
    public List<RoomBasic> queryRoomBasics(RoomBasic queryBean, PageFilter pf) throws Exception;

    /**
     * 查询频道数量
     *
     * @param queryBean
     * @return
     */
    public Long countRoomBasics(RoomBasic queryBean) throws Exception;

    /**
     * 获取频道
     *
     * @param rid
     * @return
     */
    public RoomBasic getRoomBasicByRid(long rid);

    /**
     * 创建/修改频道
     *
     * @param room
     */
    public RoomBasic saveRoomBasic(RoomBasic room) throws Exception;

    /**
     * 创建/修改频道窗口
     *
     * @param room
     */
    public RoomBasic saveRoomWin(RoomBasic room) throws Exception;

    /**
     * 删除频道
     *
     * @param rid
     */
    public RoomBasic delRoomBasic(long rid) throws Exception;
    /**
     * 删除频道
     *
     * @param bean
     */
    public RoomBasic delRoomBasic(RoomBasic bean) throws Exception;

    /**
     * 查询频道成员
     *
     * @param queryBean
     * @param pf
     * @return
     */
    public List<RoomMember> queryRoomMemers(RoomMember queryBean, PageFilter pf) throws Exception;

    public List<RoomMember> queryAllRoomMembers(RoomMember queryBean) throws Exception;

    /**
     * 查询删除成员的所在频道
     *
     * @param uids
     * @return
     */
    public List<RoomBasic> queryDelUserRoomBasics(String uids) throws Exception;

    /**
     * 获取频道成员
     *
     * @param rid
     * @return
     */
    public RoomMember getRoomMember(long rid, long uid);

    /**
     * 查询频道成员数量
     *
     * @param queryBean
     * @return
     */
    public Long countRoomMembers(RoomMember queryBean) throws Exception;

    /**
     * 新增修改频道成员
     *
     * @param member
     */
    public void saveRoomMember(RoomMember member) throws Exception;

    /**
     * 删除频道成员
     *
     * @param rid
     * @param uid
     * @throws Exception
     */
    public void delRoomMember(long rid, long uid) throws Exception;

    /**
     * 彻底删除频道成员
     *
     * @param rid
     */
    public void delUselessMembers(long rid) throws Exception;


    /**
     * 修改频道成员的权限为0，逻辑删除
     *
     * @param rid
     */
    public void delRoomMemberLogically(long rid, long uid) throws Exception;

    /**
     * 修改频道成员的权限为0，逻辑删除
     *
     * @param uid
     */
    public void delRoomMemberLogicallyByUid(long uid) throws Exception;

    /**
     * 获取频道列表
     *
     * @param bean
     * @param pf
     * @return
     * @throws Exception
     */
    public List<RoomBasic> queryRoomBasicsList(RoomBasic bean, PageFilter pf) throws Exception;


    /**
     * 发送消息
     *
     * @param sysMsgs
     */
    public void sendSysMsg(List<SysMsg> sysMsgs) throws Exception;

    /**
     * 创建频道和频道成员
     * @param roomVO
     * @throws Exception
     */
    public RoomBasic createRoom2Member(RoomVO roomVO) throws Exception;

    /**
     * 根据频道名称模糊查询频道成员
     *
     * @param userName
     * @return
     * @throws Exception
     */
    public List<RoomMember> getRoomMembersByUserName(String userName) throws Exception;

    /**
     * 获取临时过期频道
     * @return
     * @throws Exception
     */
    public List<RoomBasic> queryExpireRoom() throws Exception;

    public void updateUserName(long uid,String userName);
    /**
     * 删除频道成员
     * @param uid
     */
    public void deleteRoomMemberByUid(long uid)throws Exception;


    /**
     * 根据频道获取用户列表
     * @param rid
     * @return
     */
    public List<RoomMember> queryRoomMembersByRId(long rid);

    /**
     * 创建个人频道
     * @param roomBasic
     */
    public RoomBasic createPersonRoomBasic(RoomBasic roomBasic, long[] uids)throws Exception;


    public void setRoomMemberAdminGrade(Long uid, Long rid, Long adminGrade);

    public void setSwitchRecord(RoomBasic roomBasic);

    public void updateRoomExpiredType(Long rid ,Long expiredType, Long hour);

    public void updateRoomBasicVersion(long rid);

    public void updateRoomMemberVersion(long uid, long rid);
    public void updateRoomBasicRecordByPartyId(long partyId,long record);
}
